#include "imageswitch.h"
#include "ui_imageswitch.h"
#include "QDebug.h"

ImageSwitch::ImageSwitch(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ImageSwitch)
{
    ui->setupUi(this);
}

ImageSwitch::~ImageSwitch()
{
    delete ui;
}

void ImageSwitch::mousePressEvent(QMouseEvent *event)
{
    qDebug()<<"event:"<<event;
    if(switchFlag)
    {
        switchFlag = !switchFlag;
        ui->lb_switch->setStyleSheet("image: url(:/imageswitch/checkoff.png);");
    }
    else
    {
        switchFlag = !switchFlag;
        ui->lb_switch->setStyleSheet("image: url(:/imageswitch/checkon.png);");
    }
}
